/* Copyright (c) 2006 GCCSDK Developers
 *
 * Example module using GCC and showing how to use 'resgen'.
 */

#include <stdio.h>
#include "resfs.h" // Generated by MKRESFS
#include "module.h" // Generated by CMUNGE

_kernel_oserror *
gccmodule_init (const char *cmd_tail, int podule_base, void *pw)
{
  puts ("GCC example module initialise");

  return mkresfs_register ();
}

_kernel_oserror *
gccmodule_final (int fatal, int podule, void *pw)
{
  puts ("GCC example module finalise");

  return mkresfs_deregister ();
}

void
gccmodule_service (int service, _kernel_swi_regs *r, void *pw)
{
  switch (service)
    {
      case 0x60: /* Service_ResourceFSStarting */
        mkresfs_reregister (r->r[2], r->r[3]);
        break;
    }
}
